package com.example.big_event.validation;

import com.example.big_event.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class StateValidation implements ConstraintValidator<State,String> {
    /**
     * value 将来要校验的数据
     *
     */


    //提供校验规则
    @Override
    public boolean isValid(String value,ConstraintValidatorContext context){
        if(value==null) {
            return false;
        }
        return value.equals("已发布") || value.equals("草稿");
    }


}
